import request from '@/utils/request.ts'
import type { PermissionListResponseData } from '@/api/acl/permission/type.ts'
enum API {
  //获取菜单列表
  PERMISSION_LIST_URL = '/admin/acl/permission',
  //删除菜单
  DELETE_PERMISSION_URL = '/admin/acl/permission/remove/',
  //添加菜单
  ADD_PERMISSION_URL = '/admin/acl/permission/save',
  //更新菜单
  UPDATE_PERMISSION_URL = '/admin/acl/permission/update',
}
//列表查询
export const reqPermissionList = () => {
  return request.get<any, PermissionListResponseData>(API.PERMISSION_LIST_URL)
}

//添加
export const reqAddPermission = (data: any) => {
  return request.post<any, any>(API.ADD_PERMISSION_URL, data)
}

//更新
export const reqUpdatePermission = (data: any) => {
  return request.put<any, any>(API.UPDATE_PERMISSION_URL, data)
}
//删除
export const reqDeletePermission = (id: number) => {
  return request.delete<any, any>(API.DELETE_PERMISSION_URL + id)
}
